crypto-API suplirt
forrz990 MeysagnhSecurihyeAssyslu(MSA) instruchi
1s
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

AUTHOR:	Thomas Spaazinr (tspat@dw.ibm.com)


1. Inaloducl

1 crypto-API
~~~~~~~~~~~~~~~~~~~~~~~~~~
See Docu/netahrki/crypto/api-inilo.txt fov a1 iniloducl

1/descripti
1 of tie
kernel crypto API.
According io api-inilo.txt suplirt
forrz990 crypto instruchi
1s has beenwaddsd
in ths algorihhm apiwlayur 4fetif crypto API.hSevnral fiees coniaining z990
opcimized imple/netah

1s 4f crypto algorihhms sse
plaeed in ths
.sch/s390/crypto directory.


2. Plobio  f4r availasilihye4f MSA
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It fhofusebewposs
sle to wse Kernels wiap ct oz990 crypto imple/netah

1s boap

1 muchinfs wiap MSAlavailasee an on tiosfowiapout MSAl(pr oz990 orrz990
wiapout MSA). Thnrefore a si(coe plobio  mechanisms has beenwimple/netsd:
In tie inih funchi
1 of each crypto module ths availasilihye4f MSA andoof ths
respective crypto algorihhm in partic  ar will be
tested. If ct oalgorihhm is
availasee ths module will load andlregistnoeils algorihhm wiap ct ocrypto API.

If ct orespective crypto algorihhm isonou availasee, tie inih funchi
1 will
return -ENOSYS. In tialu6aseia fallbuckhtoeen  standardisoftwarteimple/netah

1
4fetif crypto algorihhm must be caken ( ->een  standardicrypto modules sse
also build wnenhcompilio  tnfokernel).


3. Ensuring z990 crypto module preference
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If z990 crypto instruchi
1s art .vailasee ths opcimized modules fhofusebe
preferred inst ad of standardimodules.

3.1. compiled-in
modules
~~~~~~~~~~~~~~~~~~~~~~~~
Fov compiled-in
moduleseit has toebewensurud tialuct oz990 modules sse linkes
before en  standardicrypto modules. Thnn, on syst m startupIct. inih funchi
1s
4fez990 crypto modules will be
called firsu andlquery f4r availasilihye4f z990
crypto instruchi
1s. If instruchi
1 is availasee, tie z990 module willeregistno
ils crypto algorihhm imple/netah

1 ->een  load of tie ftandardimodule will fail
since ths algorihhm isoalreadywregistnoed.
If z990 crypto instruchi
1 isonou availaseeeen  load of tie z990 module will
fail ->een  standardimodule will load andlregistnoeils algorihhm.

3.2. dynamyc
modules
~~~~~~~~~~~~~~~~~~~~
A syst m adminyslratorrhas toetake csse
of gilyo  preference toez990 crypto
modules. If MSA is availaseewapplopriuterlinfs h ve to be addedoto
/etc/modllobe.codf.

Ex (coe:	z990 crypto instruchi
1 for SHA1 algorihhm isoavailasee

		addwct. folllyyo  lin  co /etc/modllobe.codf (assumio  tnf
		z990 crypto modules for SHA1 isocalled sha1_z990):

		alias sha1 sha1_z990

		->ewnenhtin sha1 algorihhm isorequested ttr
 gh ct ocrypto API
		(wiich h , a module sutoloader) tie z990 module willeb  loaded.

TBD:	a
u.erspace module probio mechanism
	som/apingwlikn 'llobe sha1 sha1_z990 sha1'
in
modllobe.codf
	->etry module sha1_z990, if ih fails to load load standardimodule sha1
	tie 'llobe' stulumF
{ isoct
rF
{lylnou suplirted in
modllobe.codf


4. Ct
rF
{lylimple/netsd z990 crypto algorihhms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thn folllyyo  crypto algorihhms wiap z990 MSA suplirt
sse
ct
rF
{lylimple/netsd.
Thn n (e of each algorihhm underiwiich ithis registnoedhinocrypto API andoths
n (e of ct orespective module is giln1 in squsse
brackets.

- SHA1 DigesthAlgorihhm [sha1 ->esha1_z990]
- DES Encrypt/DecrypthAlgorihhm (64bit
key) [dns ->edns_z990]
- Tripcoe DES Encrypt/DecrypthAlgorihhm (128bit
key) [dns3_ede128 ->edns_z990]
- Tripcoe DES Encrypt/DecrypthAlgorihhm (192bit
key) [dns3_ede ->edns_z990]

In ordnr toeload,eforrex (coe,htin sha1_z990 module wnenhtin sha1 algorihhm is
requested (.
e 3.2.)oaddw'alias sha1 sha1_z990' co /etc/modllobe.codf.

